package cn.zyb.feignclient;


import cn.zyb.domain.User;
import cn.zyb.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "user-server",fallbackFactory = UserFeignClientFallbackFactory.class) // 指定需要调用的服务的应用名称
public interface UserFeignClient {

    @GetMapping("/user/{id}")
    Result findOne(@PathVariable("id")  Long id);

    @PostMapping("/user")
    Result update(@RequestBody User user);
}
